/**
 * 
 */
package org.mediahouse.trac.model;

/**
 * @author Tin
 * @version %I%, %G%
 * 
 */
public class Event extends AbstractItem implements Item {

    /**
     * Constructs a new event instance with a user-specified UID.
     * 
     * @param uid
     *            the UID string to store for this new event
     */
    public Event(final String uid) {
        super(uid);
    }

    @Override
    public String getDescription() {
        return this.getProperty("description").toString();
    }

    @Override
    public String getId() {
        return this.uid();
    }

    /**
     * Defines the textual description of this event using the given string of
     * text.
     * 
     * @param text
     *            the text to set as the description of this event
     * @return a convenient reference back to this event for chaining
     */
    public Event setDescription(final String text) {
        return this.setProperty("description", text);
    }

    /**
     * {@inheritDoc}
     * 
     * @return a convenient reference back to this {@code Event} instance for
     *         chaining
     */
    @Override
    public Event setProperty(final String field, final Object value) {
        return (Event) super.setProperty(field, value);
    }

}
